/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package stuff;

import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.table.TableCellRenderer;

/**
 *
 * @author JArik
 */
public class TableTextAreaRenderer extends JTextPane
    implements TableCellRenderer{

  public TableTextAreaRenderer() {
    
    //this.setLineWrap(true);
    
    //setWrapStyleWord(true);
  }

    @Override
    public Component getTableCellRendererComponent(JTable table, Object value,
                                                   boolean isSelected, boolean arg3,
                                                   int arg4, int arg5)
    {
         if (isSelected) {
           setForeground(table.getSelectionForeground());
           super.setBackground(table.getSelectionBackground());

         } else {
           setForeground(table.getForeground());
           setBackground(table.getBackground());
         }
         /*String text = "<html><table<tr><td class=row-label align=left valign=top>"+
"<textarea "+
"style=\"vertical-align: top; font-family:Arial\""+
"rows=2 cols=50 name=\"t2id\">"+value.toString()+"</textarea>"+
"</td></tr>";*/
       setText(value.toString());
       return this;
    }


}
